{% extends "layouts/application.html" %}
{% block content %}

<script type="text/javascript">
	function pageselectCallback(page_id, jq){
		//alert(page_id)
		window.location.href="?page="+(page_id+1);
    }
    $(document).ready(function(){
		// Create pagination element
        $("#Pagination").pagination({{objects.paginator.count}}, {
			num_edge_entries: 2,
			num_display_entries: 8,
			current_page:({{objects.number}}-1),
            callback: pageselectCallback
        });
    });
    function to_thumb(id){
    	window.location.href="../show_files_pic/ca_"+id+"type_1";
    }
</script>
<DIV align="center">
  <DIV class=boxright>
    <DIV class=bltop2>
      <DIV align="left">
      &nbsp;&nbsp;&nbsp;<strong>当前位置：
      &nbsp;&nbsp;<a href="#">论坛</a>
      &nbsp;&nbsp; </strong>
      </DIV>
    </DIV>
    <BR/>
    <DIV id="page">
      <DIV class=actions>
        <DIV class=buttons> <A class=new_topic title="发表新帖" href="../new"></A> </DIV>
      </DIV>
      <TABLE id=forum_main cellSpacing=1 BORDER="1">
        <THEAD>
          <TR>
            <TD style="BORDER-LEFT: white 1px solid" WIDTH="40%">主题</TD>
            <TD WIDTH="5%">回复</TD>
            <TD WIDTH="5%">作者</TD>
            <TD WIDTH="5%">阅读</TD>
            <TD style="BORDER-RIGHT: white 1px solid;" WIDTH="10%">发表时间</TD>
            {% if user.is_superuser %}
              <TD WIDTH="5%">&nbsp;</TD>
            {% endif %}
          </TR>
        </THEAD>
        <TBODY>
          {% for subject in objects.object_list %}
            <TR>

              <TD ALIGN="left" class="topic_title">
                <a href="{{subject.get_repy_path}}">{{subject.title}}</a>
              </TD>
              <TD class=topic_replies>
                {{subject.repe_nums}}
              </TD>
              <TD class=topic_author>{{subject.author}}</TD>
              <TD class=topic_view_count>
                {{subject.read_nums}}
              </TD>
              <TD class=topic_last_post>

               {{subject.date|date:"Y.n.j:h.i."}}
              </TD>
              {% if user.is_superuser %}
                <TD>
                  <a href="/{%site_root%}/manage/forum/delete_post/{{subject.id}}">删除</a>
                </TD>
              {% endif %}
            </TR>
          {% endfor %}
        </TBODY>
      </TABLE>
		<div id="Pagination" class="pagination">
    </DIV>
  </DIV>
</DIV>
<BR/>
{% endblock %}
